<?php
class DeathInsideInfo extends ORDataObject{
	var $death_inside_info_id	= '';
	var $patient_id				= '';
	var $department_id			= '';
	var $check_in_time			= '';
	var $death_time				= '';
	var $check_out_death_time	= '';
    var $doctor_id				= '';
    var $preside				= '';
    var $secretary				= '';
    var $participants			= '';
    var $medication_process		= '';
    var $conclusion				= '';
    
    /**
	 * DB Table
	 */
	var $_table = 'death_inside_info';

	/**
	 * Primary Key
	 */
	var $_key = 'death_inside_info_id';

	/**
	 * Internal Name
	 */
	var $_internalName = 'DeathInsideInfo';
	
	/**
	 * Handle instantiation
	 */
	public function DeathInsideInfo() {
		parent::ORDataObject();
	}
	
	public function getCheckInDate(){
        return $this->getLocalizedDate('check_in_time');
    }
    
	public function getCheckInTime($type='hh:mm'){
        $time  =   $this->getLocalizedDate('check_in_time', 'short', 'time');
        $parts =   explode(':', $time);
        switch (strtolower($type)){
        	case 'hh':
        	   return $parts[0];
        	   break;
        	case 'mm':
        	   return $parts[1];
               break;
            case 'hh:mm':
               return $parts[0] . ":" . $parts[1];
               break;
            default:
               return $time;
               break;
        }
    }

	public function getDeathDate(){
        return $this->getLocalizedDate('death_time');
    }
    
	public function getDeathTime($type='hh:mm'){
        $time  =   $this->getLocalizedDate('death_time', 'short', 'time');
        $parts =   explode(':', $time);
        switch (strtolower($type)){
        	case 'hh':
        	   return $parts[0];
        	   break;
        	case 'mm':
        	   return $parts[1];
               break;
            case 'hh:mm':
               return $parts[0] . ":" . $parts[1];
               break;
            default:
               return $time;
               break;
        }
    }

	public function getCheckOutDeathDate(){
        return $this->getLocalizedDate('check_out_death_time');
    }
    
	public function getCheckOutDeathTime($type='hh:mm'){
        $time  =   $this->getLocalizedDate('check_out_death_time', 'short', 'time');
        $parts =   explode(':', $time);
        switch (strtolower($type)){
        	case 'hh':
        	   return $parts[0];
        	   break;
        	case 'mm':
        	   return $parts[1];
               break;
            case 'hh:mm':
               return $parts[0] . ":" . $parts[1];
               break;
            default:
               return $time;
               break;
        }
    }
}
?>